import Vue from 'vue'
import Vuex from 'vuex'
import cacheHandler from '@/utils/cacheHandler'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    themeName: cacheHandler.getTheme() || 'default-theme'
  },
  mutations: {
    setTheme(state, themeName = 'default-theme') {
      state.themeName = themeName
    }
  }
})

export default store
